1. Alter the Joomgallery component to embed Mailorder. Please put the Mailorder tags in the images' descriptions.

 a) Open /components/com_joomgallery/views/detail/tmpl/default.php.

 Right in the beginning of the file, just bellow the "defined('_JEXEC') or die('Direct Access to this location is not allowed.');" code, insert:

 #Mailorder BOM
 if (JPluginHelper::importPlugin('content','mailorder',true)) {
 $params = new JRegistry();
 $data = new stdClass();
 $data->text = $this->image->imgtext;
 $data->id = $this->image->id;
 $data->catid = $this->image->catid;
 $data->mailorderreturn = TRUE;
 JDispatcher::getInstance()->trigger('plgMailOrderInvoke', array('_com_joomgallery.image', &$data, &$params));
 $this->image->imgtext = $data->text;
 $this->image->atagtitle = 'title="'.$this->image->imgtitle.' '.$data->text.'"';
 }
 #Mailorder EOM

 Then put the following code right where you want the Mailorder link to appear, e.g. right after the "</h3>" tag:

 <?php
 #Mailorder BOM
 if (!empty($data->mailorderlink))
 echo '<center>', $data->mailorderlink, '</center><br />';
 #Mailorder EOM
 ?>

 b) Alter the category view in order to hide the Mailorder tag in the images' descriptions. Open /components/com_joomgallery/views/category/tmpl/default_images.php

 Right in the beginning of the file, just bellow the "defined('_JEXEC') or die('Direct Access to this location is not allowed.');" code, insert:

 $mailorder = FALSE;
 if (JPluginHelper::importPlugin('content','mailorder',true)) {
 $mailorder = TRUE;
 $params = new JRegistry();
 $data = new stdClass();
 $data->mailorderreturn = TRUE;
 }

 Set the plugin (if enabled) to remove the Mailorder tag from the images' descriptions. Find the following code (lines 32 - 33):

 <?php for($col_count = 0; ($col_count < $column) && ($index < $count_pics); $col_count++):
 $row = $this->images[$index]; ?>

 Replace it with:

 <?php
 for($col_count = 0; ($col_count < $column) && ($index < $count_pics); $col_count++):
 $row = $this->images[$index];
 if ($mailorder && FALSE !== JString::strpos($row->imgtext, '{mailorder')) {
 $data->text = $row->imgtext;
 $data->id = $row->id;
 $data->catid = $row->catid;
 JDispatcher::getInstance()->trigger('plgMailOrderInvoke', array('_com_joomgallery.image', &$data, &$params));
 $row->imgtext = $data->text;
 }
 ?>
 